\(\int \frac {\cot (a+i \log (x))}{x^4} \, dx\) [193]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 45 \[ \int \frac {\cot (a+i \log (x))}{x^4} \, dx=-\frac {i}{3 x^3}-\frac {2 i e^{-2 i a}}{x}+2 i e^{-3 i a} \text {arctanh}\left (e^{-i a} x\right ) \]

[Out]

-1/3*I/x^3-2*I/exp(2*I*a)/x+2*I*arctanh(x/exp(I*a))/exp(3*I*a)

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {4592, 456, 464, 331, 213} \[ \int \frac {\cot (a+i \log (x))}{x^4} \, dx=2 i e^{-3 i a} \text {arctanh}\left (e^{-i a} x\right )-\frac {2 i e^{-2 i a}}{x}-\frac {i}{3 x^3} \]

[In]

Int[Cot[a + I*Log[x]]/x^4,x]

[Out]

(-1/3*I)/x^3 - (2*I)/(E^((2*I)*a)*x) + ((2*I)*ArcTanh[x/E^(I*a)])/E^((3*I)*a)

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 331

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c*x)^(m + 1)*((a + b*x^n)^(p + 1)/(a*c
*(m + 1))), x] - Dist[b*((m + n*(p + 1) + 1)/(a*c^n*(m + 1))), Int[(c*x)^(m + n)*(a + b*x^n)^p, x], x] /; Free
Q[{a, b, c, p}, x] && IGtQ[n, 0] && LtQ[m, -1] && IntBinomialQ[a, b, c, n, m, p, x]

Rule 456

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Int[x^(m + n*(p + q
))*(b + a/x^n)^p*(d + c/x^n)^q, x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[b*c - a*d, 0] && IntegersQ[p, q] &&
NegQ[n]

Rule 464

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[c*(e*x)^(m +
 1)*((a + b*x^n)^(p + 1)/(a*e*(m + 1))), x] + Dist[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(a*e^n*(m + 1)), In
t[(e*x)^(m + n)*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, p}, x] && NeQ[b*c - a*d, 0] && (IntegerQ[n] ||
GtQ[e, 0]) && ((GtQ[n, 0] && LtQ[m, -1]) || (LtQ[n, 0] && GtQ[m + n, -1])) &&  !ILtQ[p, -1]

Rule 4592

Int[Cot[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.)*((e_.)*(x_))^(m_.), x_Symbol] :> Int[(e*x)^m*((-I - I*E^(2*I*a*d)
*x^(2*I*b*d))/(1 - E^(2*I*a*d)*x^(2*I*b*d)))^p, x] /; FreeQ[{a, b, d, e, m, p}, x]

Rubi steps \begin{align*} \text {integral}& = \int \frac {-i-\frac {i e^{2 i a}}{x^2}}{\left (1-\frac {e^{2 i a}}{x^2}\right ) x^4} \, dx \\ & = \int \frac {-i e^{2 i a}-i x^2}{x^4 \left (-e^{2 i a}+x^2\right )} \, dx \\ & = -\frac {i}{3 x^3}-2 i \int \frac {1}{x^2 \left (-e^{2 i a}+x^2\right )} \, dx \\ & = -\frac {i}{3 x^3}-\frac {2 i e^{-2 i a}}{x}-\left (2 i e^{-2 i a}\right ) \int \frac {1}{-e^{2 i a}+x^2} \, dx \\ & = -\frac {i}{3 x^3}-\frac {2 i e^{-2 i a}}{x}+2 i e^{-3 i a} \text {arctanh}\left (e^{-i a} x\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.56 \[ \int \frac {\cot (a+i \log (x))}{x^4} \, dx=-\frac {i}{3 x^3}-\frac {2 i \cos (2 a)}{x}+2 i \text {arctanh}(x \cos (a)-i x \sin (a)) \cos (3 a)-\frac {2 \sin (2 a)}{x}+2 \text {arctanh}(x \cos (a)-i x \sin (a)) \sin (3 a) \]

[In]

Integrate[Cot[a + I*Log[x]]/x^4,x]

[Out]

(-1/3*I)/x^3 - ((2*I)*Cos[2*a])/x + (2*I)*ArcTanh[x*Cos[a] - I*x*Sin[a]]*Cos[3*a] - (2*Sin[2*a])/x + 2*ArcTanh
[x*Cos[a] - I*x*Sin[a]]*Sin[3*a]

Maple [A] (verified)

Time = 0.22 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.78

method result size
risch \(-\frac {i}{3 x^{3}}+2 i \operatorname {arctanh}\left (x \,{\mathrm e}^{-i a}\right ) {\mathrm e}^{-3 i a}-\frac {2 i {\mathrm e}^{-2 i a}}{x}\) \(35\)

[In]

int(cot(a+I*ln(x))/x^4,x,method=_RETURNVERBOSE)

[Out]

-1/3*I/x^3+2*I*arctanh(x*exp(-I*a))*exp(-3*I*a)-2*I*exp(-2*I*a)/x

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.22 \[ \int \frac {\cot (a+i \log (x))}{x^4} \, dx=\frac {{\left (3 i \, x^{3} e^{\left (-i \, a\right )} \log \left (x + e^{\left (i \, a\right )}\right ) - 3 i \, x^{3} e^{\left (-i \, a\right )} \log \left (x - e^{\left (i \, a\right )}\right ) - 6 i \, x^{2} - i \, e^{\left (2 i \, a\right )}\right )} e^{\left (-2 i \, a\right )}}{3 \, x^{3}} \]

[In]

integrate(cot(a+I*log(x))/x^4,x, algorithm="fricas")

[Out]

1/3*(3*I*x^3*e^(-I*a)*log(x + e^(I*a)) - 3*I*x^3*e^(-I*a)*log(x - e^(I*a)) - 6*I*x^2 - I*e^(2*I*a))*e^(-2*I*a)
/x^3

Sympy [A] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.20 \[ \int \frac {\cot (a+i \log (x))}{x^4} \, dx=- \left (i \log {\left (x - e^{i a} \right )} - i \log {\left (x + e^{i a} \right )}\right ) e^{- 3 i a} - \frac {\left (6 i x^{2} + i e^{2 i a}\right ) e^{- 2 i a}}{3 x^{3}} \]

[In]

integrate(cot(a+I*ln(x))/x**4,x)

[Out]

-(I*log(x - exp(I*a)) - I*log(x + exp(I*a)))*exp(-3*I*a) - (6*I*x**2 + I*exp(2*I*a))*exp(-2*I*a)/(3*x**3)

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 139 vs. \(2 (28) = 56\).

Time = 0.21 (sec) , antiderivative size = 139, normalized size of antiderivative = 3.09 \[ \int \frac {\cot (a+i \log (x))}{x^4} \, dx=-\frac {3 \, x^{3} {\left (-i \, \cos \left (3 \, a\right ) - \sin \left (3 \, a\right )\right )} \log \left (x^{2} + 2 \, x \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (a\right )^{2}\right ) + 3 \, x^{3} {\left (i \, \cos \left (3 \, a\right ) + \sin \left (3 \, a\right )\right )} \log \left (x^{2} - 2 \, x \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (a\right )^{2}\right ) + 6 \, {\left ({\left (\cos \left (3 \, a\right ) - i \, \sin \left (3 \, a\right )\right )} \arctan \left (\sin \left (a\right ), x + \cos \left (a\right )\right ) + {\left (\cos \left (3 \, a\right ) - i \, \sin \left (3 \, a\right )\right )} \arctan \left (\sin \left (a\right ), x - \cos \left (a\right )\right )\right )} x^{3} + 12 \, x^{2} {\left (i \, \cos \left (2 \, a\right ) + \sin \left (2 \, a\right )\right )} + 2 i}{6 \, x^{3}} \]

[In]

integrate(cot(a+I*log(x))/x^4,x, algorithm="maxima")

[Out]

-1/6*(3*x^3*(-I*cos(3*a) - sin(3*a))*log(x^2 + 2*x*cos(a) + cos(a)^2 + sin(a)^2) + 3*x^3*(I*cos(3*a) + sin(3*a
))*log(x^2 - 2*x*cos(a) + cos(a)^2 + sin(a)^2) + 6*((cos(3*a) - I*sin(3*a))*arctan2(sin(a), x + cos(a)) + (cos
(3*a) - I*sin(3*a))*arctan2(sin(a), x - cos(a)))*x^3 + 12*x^2*(I*cos(2*a) + sin(2*a)) + 2*I)/x^3

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 43, normalized size of antiderivative = 0.96 \[ \int \frac {\cot (a+i \log (x))}{x^4} \, dx=i \, e^{\left (-3 i \, a\right )} \log \left (x + e^{\left (i \, a\right )}\right ) - i \, e^{\left (-3 i \, a\right )} \log \left (-x + e^{\left (i \, a\right )}\right ) - \frac {2 i \, e^{\left (-2 i \, a\right )}}{x} - \frac {i}{3 \, x^{3}} \]

[In]

integrate(cot(a+I*log(x))/x^4,x, algorithm="giac")

[Out]

I*e^(-3*I*a)*log(x + e^(I*a)) - I*e^(-3*I*a)*log(-x + e^(I*a)) - 2*I*e^(-2*I*a)/x - 1/3*I/x^3

Mupad [B] (verification not implemented)

Time = 27.51 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.98 \[ \int \frac {\cot (a+i \log (x))}{x^4} \, dx=\frac {\mathrm {atan}\left (\frac {x}{\sqrt {-{\mathrm {e}}^{a\,2{}\mathrm {i}}}}\right )\,2{}\mathrm {i}}{{\left (-{\mathrm {e}}^{a\,2{}\mathrm {i}}\right )}^{3/2}}-\frac {2{}\mathrm {i}\,{\mathrm {e}}^{-a\,2{}\mathrm {i}}\,x^2+\frac {1}{3}{}\mathrm {i}}{x^3} \]

[In]

int(cot(a + log(x)*1i)/x^4,x)

[Out]

(atan(x/(-exp(a*2i))^(1/2))*2i)/(-exp(a*2i))^(3/2) - (x^2*exp(-a*2i)*2i + 1i/3)/x^3